package org.usmile.algorithms.huawei.acm;

import java.util.Arrays;
import java.util.Scanner;

// https://blog.csdn.net/qq_34465338/article/details/128676053
public class _天然蓄水库 {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);

        Integer[] heights =
                Arrays.stream(sc.nextLine().split(" ")).map(Integer::parseInt).toArray(Integer[]::new);

        System.out.println(getResult(heights));
    }

    public static String getResult(Integer[] heights) {
        Integer[] ans = new Integer[]{0, 0, 0};

        int left = 0;
        int right = heights.length - 1;
        int maxSum = 0;

        while (left < right) {
            int sum = 0;
            int height = Math.min(heights[left], heights[right]);

            for (int i = left; i <= right; i++) {
                sum += Math.max(0, height - heights[i]);
            }

            if (sum >= maxSum) {
                ans = new Integer[]{left, right, sum};
                maxSum = sum;
            }

            if (heights[left] < heights[right]) {
                if (heights[right - 1] >= heights[right]) {
                    right--;
                } else {
                    left++;
                }
            } else if (heights[left] > heights[right]) {
                if (heights[left + 1] >= heights[left]) {
                    left++;
                } else {
                    right--;
                }
            } else {
                if (heights[left + 1] > heights[right - 1]) {
                    left++;
                } else {
                    right--;
                }
            }
        }

        if (ans[2] == 0) return "0";
        return ans[0] + " " + ans[1] + ":" + ans[2];
    }
}
